<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>骑手管理</title>
    <#include "/include/resource.html"/>
    <style>
    </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "/include/header.html"/>
    <!-- Left side column. contains the logo and sidebar -->
    <#include "/include/main-sidebar.html"/>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                会员列表
                <small>会员信息列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><i class="fa fa-dashboard"></i> 会员列表</li>
                <li class="active">会员信息列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <form id="tableForm" method="post" class="form-horizontal" action="${base}/admin/rider/list">
            <section class="content queryForm">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box">

                            <!-- /.box-header -->
                            <div class="box-body">
                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-md-2">
                                            <label for="inputEmail3_" class="col-md-4 control-label">Name</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" value="${(riderName)!''}"
                                                       name="riderName" id="inputEmail3_" placeholder="Name">
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <label for="inputEmail3_" class="col-md-4 control-label">电话</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" value="${(phone)!''}"
                                                       name="phone" id="inputEmail4_" placeholder="电话号码">
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <label for="inputEmail3_" class="col-md-4 control-label">注册时间：</label>
                                            <div class="col-md-8 input-daterange input-group" id="datepicker">
                                                <input type="text" class="form-control input-sm" value="${(beginDate)!''}"
                                                       name="beginDate">
                                                <span class="input-group-addon">至</span>
                                                <input type="text" class="form-control input-sm" value="${(endDate)!''}"
                                                       name="endDate">
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <label for="inputEmail3_" class="col-md-4 control-label">集团Name：</label>
                                            <div class="col-md-8">
                                                <input type="text" class="form-control" value="${(companyName)!''}"
                                                       name="companyName" id="companyName" placeholder="集团Name">
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <label for="inputEmail3_" class="col-md-4 control-label">Status：</label>
                                            <div class="col-md-8">
                                                    <select name="state" id="state" class="form-control">
                                                        <option value="">----所有----</option>
                                                        <option value="0" <#if ((state)!-1)==0> selected="selected"</#if>>----未激活----</option>
                                                        <option value="1" <#if ((state)!-1)==1> selected="selected"</#if>>----已激活----</option>
                                                    </select>
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                            <span>
                                            <button type="button" onclick="HF.listQuery();"
                                                    class="btn btn-primary">Query
                                            </button>
                                            <button style="float: right;" type="button" onclick="HF.listExcelExport();"
                                                    class="btn btn-primary">导出
                                            </button>
                                                </span>
                                        </div>
                                    </div>
                                </div>
                                <table class="table table-bordered">
                                    <tr>
                                        <th>SequenceNo</th>
                                        <th>区域</th>
                                        <th>姓名</th>
                                        <th>联系方式</th>
                                        <th>身份证正面</th>
                                        <th>身份证反面</th>
                                        <th>集团Name</th>
                                        <th>Status</th>
                                        <th>到期时间</th>
                                        <th>Note</th>
                                        <th>ActionList</th>
                                    </tr>
                                    <#if list??&&list?size gt 0>
                                        <#list list as t>
                                            <tr>
                                                <td>${t_index+1}</td>
                                                <td>${(t.department.name)!"--"}</td>
                                                <td>${(t.name)!"--"}</td>
                                                <td>${(t.phone)!"--"}</td>
                                                <td>
                                                    <a href="${(t.cardFront)!}" target="_blank">
                                                        <img src="${(t.cardFront)!}" style="width: 100px;height: 50px">
                                                    </a>
                                                </td>
                                                <td>
                                                    <a href="${(t.cardReverse)!}" target="_blank">
                                                        <img src="${(t.cardReverse)!}" style="width: 100px;height: 50px">
                                                    </a>
                                                </td>
                                                <td>${(t.companyName)!}</td>
                                                <td>${(t.getStateStr())!"--"}</td>
                                                <td style="color: <#if t.days?? && t.days lt 1>red<#elseif t.days?? && t.days lt 4>orange<#else>black</#if> ">
                                                    <#if t.endDate??>
                                                        ${t.endDate?number_to_datetime?string('yyyy-MM-dd')}
                                                    </#if>
                                                </td>
                                                <td>${(t.memo)!}</td>
                                                <td>
                                                    <a href="#" onclick="HF.showDialog('${base}/admin/rider/operate?id=${t.id?c}')">核准激活</a>
                                                    <a href="#" onclick="$('.modal-dialog').css('width','1000px');HF.showDialog('${base}/admin/admin_order/payLog/list?riderId=${t.id?c}')">充值记录</a>
                                                    <a href="${base}/admin/discountLog/list?riderId=${t.id?c}">优惠券</a>
                                                </td>
                                            </tr>
                                        </#list>
                                    </#if>
                                </table>
                            </div>
                            <!-- /.box-body -->
                            <@p.pager pageNo=pageNo pageSize=pageSize totalCount=totalCount />
                        </div>
                        <!-- /.box -->
                    </div>
                </div>
            </section>
        </form>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <#include "/include/modal.html"/>
    <#include "/include/footer.html"/>
    <div class="control-sidebar-bg"></div>
</div>
<#include "/include/js_footer.html"/>
</body>
</html>
<script>
    $(function(){
        $.fn.datepicker.defaults.format = "yyyy-mm-dd";
        $('#datepicker').datepicker({
            autoclose: true
        })
    })
    function setState(state,id) {
        $.ajax({
            type: "GET",
            url: "/admin/rider/setState?id="+id+"&state="+state,
            dataType: "json",
            success: function(data){
                alert("设置 Success");
                document.location.reload();
            },
            error:function(){
                alert("系统未知异常!");
            }
        });
    }
</script>
